package com.tan.androidtest.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.tan.androidtest.R;

/**
 * Created by Administrator on 2017/11/28.
 */

public class ChildLazyFragment extends LazyFragment {

    private TextView tv_content;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = LayoutInflater.from(getContext()).inflate(R.layout.fragment_child_lazy_layout, container, false);
        init(view);
        isViewPrepared = true;
        return view;
    }

    /**
     * 初始化view
     */
    private void init(View view) {
        tv_content = view.findViewById(R.id.tv_content);
    }

    @Override
    protected void onFirstVisibleToUser() {
        Log.i("==--", "onFirstVisibleToUser");
        tv_content.setText("哈哈1");
        isDataLoadCompelete = true;
    }
}
